package edu.kjxy.worker0312;

public class worker04 {

	public static void main(String[] args) {
		int totalAnimal = 60;
		int totalFeet = 180;
		
		//假设都是鸡
		int chikens = totalAnimal;
		int rabbits = 0;
		for(int i = 0; i <= totalAnimal; i++)
		{
			chikens = totalAnimal -  i;
			rabbits = i;
			
			int currentFeet = 2 * chikens + 4 * rabbits;
			if(currentFeet == totalFeet) break;
		}
		System.out.println("鸡的数量：" + chikens);
		System.out.println("兔的数量：" + rabbits);
	}

}
